Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check "is_ssl()" and change $uri #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tordans
Copy link

@tordans tordans commented May 15, 2014

Our Server force SSL but WordPress does not understand it. So the
default URLs are not right. This change fixes this issue.

Our Server focus SSL but WordPress does not understand it. So the
default URLs are not right. This change fixes this issue.
@dboune
Copy link

dboune commented Jul 27, 2014

Noting that the modification in this PR is in vendored code managed elsewhere. I had a similar need to output https urls when using FORCE_ADMIN_SSL and so I made a similar change in the WPLessPlugin::processStylesheet function.

--- wp-content/plugins/wp-less.orig/lib/Plugin.class.php    Sun Jul 27 16:22:12 2014
+++ wp-content/plugins/wp-less/lib/Plugin.class.php Sun Jul 27 23:21:00 2014
@@ -196,7 +196,13 @@
             $this->compiler->cacheStylesheet($stylesheet, $force);
         }

-        $wp_styles->registered[$handle]->src = $stylesheet->getTargetUri();
+        $stylesheet_uri = $stylesheet->getTargetUri();
+
+        if (is_ssl()) {
+            $stylesheet_uri = preg_replace("/^http:/i", "https:", $stylesheet_uri);
+        }
+
+        $wp_styles->registered[$handle]->src = $stylesheet_uri;

         return $stylesheet;
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants